﻿using Prism.Commands;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;

namespace KinTN_WMS_CL.UserControlModels
{
    public class WindowBase : Window
    {
        public ICommand CloseCommand { get; }
        public ICommand MinimizeCommand { get; }
        public ICommand MaximizeCommand { get; }

        public WindowBase()
        {
            CloseCommand = new DelegateCommand(OnClose);
            MinimizeCommand = new DelegateCommand(OnMinimize);
            MaximizeCommand = new DelegateCommand(OnMaximize);
        }

        private void OnClose()
        {
            this.Close();
        }

        private void OnMinimize()
        {
            this.WindowState = WindowState.Minimized;
        }

        private void OnMaximize()
        {
            if (this.WindowState == WindowState.Maximized)
                this.WindowState = WindowState.Normal;
            else
                this.WindowState = WindowState.Maximized;
        }
    }
}
